import java.util.*;

/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2022-09-26
 * Time: 20:52
 */
//集合框架
public class Test05 {

    public static void main(String[] args) {
        Map<Integer,String> map = new HashMap<>();

        map.put(001,"林逸");
        map.put(002,"楚梦瑶");
        map.put(003,"陈雨舒");
        map.put(004,"唐韵");

        Set<Map.Entry<Integer,String>> entries = map.entrySet();
        for (Map.Entry<Integer,String> e : entries) {
            System.out.println(e);
        }


//        System.out.println(map.containsKey(004));
//        System.out.println(map.containsValue("陈雨舒"));

//        System.out.println(map.getOrDefault(001, "ly"));
//        System.out.println(map.getOrDefault(005, "天蝉"));

//        System.out.println(map.get(001));
//        System.out.println(map.get(004));

//        System.out.println(map.size());
//        System.out.println(map.isEmpty());
    }

    public static void main1(String[] args) {
        Collection<String> list = new ArrayList<>();
//        System.out.println(list);
//        System.out.println(list.size());
//        System.out.println(list.isEmpty());
        list.add("l");
        list.add("love");
        list.add("java");

        Object[] objects = list.toArray();
        System.out.println(Arrays.toString(objects));

//        for (String s : list) {
//            System.out.println(s);
//        }

//        Object[] arr = list.toArray();
//        for (Object object : arr) {
//            System.out.println(object);
//        }

//        list.clear();
//        list.remove("love");
//        System.out.println(list);

//        System.out.println(list);
//        System.out.println(list.size());
//        System.out.println(list.isEmpty());

    }
}
